#include <iostream>
using namespace std;

int main_36()
{
    int n,omega_i,score_i,y=0;
    scanf("%d",&n);
    for (int i=0;i<n ;i++ )
    {
        scanf("%d%d",&omega_i,&score_i);
        y+=omega_i*score_i;
    }
    printf("%d\n",max(y,0));
	return 0;
}
